<template>
  <h1>app</h1>
  <breadCrumb :data="data" separator="·"></breadCrumb>
  <router-view></router-view>
</template>
<script setup>
import {ref,getCurrentInstance,onMounted} from 'vue'

let data = ref([])

//1.在setup中如何使用eventBus

//2.reactive声明的变量重新赋值，丢失响应

//3.如何获取全局的propertie属性

//4.全局创建组件&简单封装面包屑

onMounted(()=>{
  // console.log(getCurrentInstance())
  // console.log(getCurrentInstance().ctx)
  let instance = getCurrentInstance()   //获取组件实例

  //获取app全局添加的属性
  let $bus = instance.appContext.config.globalProperties.$bus
  $bus.$on('breadChange',input=>{
    // console.log(input)
    data.value = input
  })


})

</script>